import datetime

import pygame

from lib.Function import NumBox
from lib.sittings import info, SCREENRECT


def die(currentscore, screen):
    info(f"    * :game over:  [{datetime.datetime.now()}] game over...")
    NumBox.end(currentscore)
    f = pygame.font.Font(None, 300)
    failmessage = f.render('FAIL', True, (0, 0, 0))
    failrect = failmessage.get_rect()
    failrect.center = SCREENRECT.center
    screen.blit(failmessage, failrect)
    pygame.display.flip()
    pygame.time.wait(2000)
    pygame.quit()
    info(f"    * :game over:  [{datetime.datetime.now()}] exit game")
    return True